#ifndef MUSICTABLE_H
#define MUSICTABLE_H
#include <QStandardItemModel>
#include <QTableView>
#include <map>
#include <QAction>
#include "newsongdialog.h"
#include "editsongdialog.h"
#include "pugixml.hpp"
#include "videoplayer.h"
#include "VideoInfo.h"

class MusicTable : public QTableView
{
    Q_OBJECT
    public:
        explicit MusicTable(QWidget *parent = 0);

    signals:
        void playSong(QString url);

    public slots:
        void add();
        void editSong();
        void songClicked(QModelIndex Data);
        void filter(QString word);
        void refresh(QList<VideoInfo>);

    private:
        QStandardItemModel* model;

        QAction* editAct;
        pugi::xml_document lib;

        void loadMusic();
        void extractVideoFromUrl(QString& url);
};

#endif // MUSICTABLE_H
